package com.bodu.exchange.client.impl;

import com.bodu.core.entity.ParamReq;
import com.bodu.core.entity.result.Result;
import com.bodu.exchange.client.ExchangeBillTypeClient;
import com.bodu.exchange.entity.request.ExchangeBillTypeRequest;
import com.bodu.exchange.entity.vo.ExchangeBillTypeVo;
import com.bodu.exchange.service.ExchangeBillTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExchangeBillTypeClientImpl implements ExchangeBillTypeClient {
    
    @Autowired
    private ExchangeBillTypeService exchangeBillTypeService;
    
    @Override
    public Result<ExchangeBillTypeVo> billTypeList(ExchangeBillTypeRequest exchangeBillTypeRequest) {
        ParamReq<ExchangeBillTypeRequest> params = new ParamReq<>();
        params.setCurrent(1);
        params.setSize(1000);
        params.setEntity(exchangeBillTypeRequest);
        
        List<ExchangeBillTypeVo> list = exchangeBillTypeService.listPage(params);
        return Result.success(list);
    }
}
